package com.song.service.impl;

import com.song.model.Dog;
import com.song.service.DogService;
import org.apache.dubbo.config.annotation.DubboService;

import java.util.HashMap;

/**
 * @ClassName : DogServiceImpl
 * @Author : 司猫子
 * @Date: 2021/3/3 8:46
 */

@DubboService(interfaceClass = DogService.class,version = "1.0",timeout = 5000)
public class DogServiceImpl implements DogService {

    private Dog dog = new Dog();
    @Override
    public int addDog(String name, Integer age, String sex) {
        dog.setAge(age);
        dog.setSex("nan");
        dog.setName("gougou");
        return 0;
    }

    @Override
    public Dog queryDog(String name) {
        System.out.println("开始查询狗");
        String name1 = dog.getName();
        if(name.equals(name1)){
            return dog;
        }else {
            dog.setName("meiyougou");
        }
        return dog;
    }
}
